﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
   public  class Navigation_导航_DAL
    {
        /// <summary>
        /// 显示导航的信息
        /// </summary>
        /// <returns></returns>
       public List<Navigation_导航_> ShowNavigation()
        {
            using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=JingRui;Integrated Security=True"))
            {
                string sql = "select * from [Navigation（导航)]";
                SqlCommand com = new SqlCommand(sql, con);
                SqlDataAdapter sd = new SqlDataAdapter(com);
                DataTable dt = new DataTable();
                sd.Fill(dt);
                List<Navigation_导航_> list = new List<Navigation_导航_>();
                foreach (DataRow item in dt.Rows)
                {
                    Navigation_导航_ a = new Navigation_导航_();
                    a.Navigationid = Convert.ToInt32(item["Navigationid"]);
                    a.Navigationname=item["Navigationname"].ToString();
                   
                   
                    list.Add(a);
                }
                return list;

            }
        }




    }
}
